import Mock from 'mockjs'

// var Mock = require('mockjs')
const data = Mock.mock({
    'data|25': [{
        'id|+1': 1,
        'kinds|1': ['口腔医院', '骨科医院', '妇科医院','儿童医院','精神科医院','肿瘤医院'],
        'grade|1': ['三甲医院', '三级级医院', '二级医院','一级医院',],
        'name': '@city@ctitle()医院',
        'image': '@dataImage',
        'desc': '@csentence(6)',
        'flag|1':[true,false]
    }]
})
Mock.mock('/gethospitalInfo', 'get', () => {
    data.code = '200'
    return data
})
Mock.mock('/gethospitalAllInfo', 'post', (config) => {
    let res =data.data
    let data1: any = res.find( (item: { id: any; }) =>{return item.id === JSON.parse(config.body).id} )
    console.log(data1);
    data.data = data1
})
